<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	
</body>
</html>
<script>
	//二维数组
	// var arr = [
 // 	[1,2,3,4],
 // 	[5,6,7,8,9]
 // 	];
// console.log(arr[0][2]);//3

// //遍历几维数组就用几层循环
// for(var i = 0; i < arr.length; i++){//length:2
// 	for(var j = 0; j < arr[i].length; j++){
// 		document.write(arr[i][j] + " ");
// 	}
// 	document.write("<br>");
// }



var stus = [["小明","小刚","小强","小胡"],
["小龙","小冰","小华","小宁"],
["小雪","小歪","小林"]
]
//创建table元素
var oTable = document.createElement("table");
document.body.appendChild(oTable);
for(var i = 0; i <stus.length; i++){
	//创建行
		oTable.insertRow();
	for(var j = 0; j < stus[i].length;j++){
         //oTable.rows获取所有行
         //inserCell创建单元格
		oTable.rows[i].insertCell();
		oTable.rows[i].cells[j].innerHTML = stus[i][j];
		


	}
}
//删除单元格
oTable.rows[2].deleteCell(1);
//删除行
oTable.deleteRow(1);


</script>